package com.bw.merchant.net

import com.bw.base.constants.ApiConst
import com.bw.common.net.BaseApiService
import com.bw.http.utils.Res
import com.bw.merchant.entity.MerchantEntity
import com.bw.merchant.entity.ProfileEntity
import okhttp3.MultipartBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query

interface ApiService :BaseApiService{
    @GET(ApiConst.URL_GET_MERCHANT)
    suspend fun getMerchant(): Res<List<MerchantEntity>>

    @POST(ApiConst.URL_POST_MERCHANT)
    suspend fun postMerchant(@Body merchantEntity: MerchantEntity): Res<MerchantEntity>

    @GET(ApiConst.URL_GET_MERCHANT_PROFILES)
    suspend fun getProfiles(): Res<List<ProfileEntity>>

    @Multipart
    @POST(ApiConst.UPLOAD_FILE)
    suspend fun uploadFile(
        @Part part: MultipartBody.Part,
        @Query("modulename") modulename: String,
        @Query("userid") userid: String
    ):Res<String>
}